<?php

require_once 'modules/ads/models/Ads.php';
require_once 'modules/ads/models/AdsCategory.php';

class ads_IndexController extends Nine_Controller_Action
{
	public function indexAction()
	{
	    $adsId = $this->_getParam('id', false);
		$objAds = new Models_Ads();
		$allAds = $objAds->getAdsbyId($adsId);
		$allAds['click']++;
		$objAds->update($allAds, array('ads_id=?' => $adsId));
		$this->_redirect($allAds['click_url']);
	}
}